package com.uno.mapsearch.dao;

import java.util.HashMap;
import java.util.Map;

import com.uno.mapsearch.model.Point;
import com.uno.mapsearch.model.Sample;


public enum SampleDao {
	instance;
	
	private Map<String, Sample> contentProvider = new HashMap<String, Sample>();
	
	private SampleDao() {
		
		Sample sample = new Sample();
		sample.setName("Manhattan Skyline");
		Point point = new Point(-73.9915788333333, 40.7084988333333);
		sample.setPoint(point);
		sample.setColor("red");
		sample.setRadioactivity("low");
		addSample(sample);
		
		sample = new Sample();
		sample.setName("Lower East Side");
		point = new Point(-73.9925443333333, 40.7102921666667);
		sample.setColor("blue");
		sample.setRadioactivity("high");
		sample.setPoint(point);
		addSample(sample);
		
//		sample = new Sample();
//		sample.setName("Manhattan Test");
//		point = new Point(-73.9925443333333, 40.7084988333333);
//		sample.setColor("yellow");
//		sample.setRadioactivity("medium");
//		sample.setPoint(point);
//		addSample(sample);
	}
	
	
	public Map<String, Sample> getModel(){
		return contentProvider;
	}
	
	public Sample addSample(Sample sample){
		String newId = Integer.toString(contentProvider.size() + 1);
		sample.setId(newId);
		contentProvider.put(newId, sample);
		return sample;
	}
}
